'use client'

import { useState } from 'react'
import AMap from '@/components/AMap'

import HomeSearch from './components/HomeSearch'
import TotalWarning from './components/TotalWarning'
import HomeAi from './components/HomeAi'

import TrafficState from './components/TrafficState'
import ZoneState from './components/ZoneState'
import RealTimeAnalysis from './components/RealTimeAnalysis'

import BottomDrawer from './components/BottomDrawer'
import TrafficDialog from './components/TrafficDialog'

import { useHomeShare } from '@/hooks/use-home-share'
import { Button } from 'antd'

export default function DashboardPage() {
  const { isDialogOpen } = useHomeShare()

  const [isModalOpen, setIsModalOpen] = useState(false)
  const [isOpenDrawer, setIsOpenDrawer] = useState(false)

  const showModal = () => {
    setIsModalOpen(true)
  }
  return (
    <div className='h-full relative'>
      {/* <Button
        type='primary'
        onClick={showModal}>
        Open Modal
      </Button> */}

      <Button
        type='primary'
        onClick={() => setIsOpenDrawer(true)}>
        Open Modal
      </Button>
      {/* 默认北京地图 */}
      {/* <AMap /> */}
      {/* 左边卡片 */}
      {/* {!isDialogOpen && <HomeSearch />}
      <TotalWarning /> */}

      {/* 右边卡片 */}
      {/* <TrafficState />
      <ZoneState />
      <RealTimeAnalysis />
      <HomeAi /> */}

      {/* 底部卡片 */}
      <BottomDrawer
        isOpenDrawer={isOpenDrawer}
        setIsOpenDrawer={setIsOpenDrawer}
      />

      <TrafficDialog
        isModalOpen={isModalOpen}
        setIsModalOpen={setIsModalOpen}
      />
    </div>
  )
}
